package com.agou.app.admin.demo.easyui.action;

import java.io.IOException;
import java.sql.SQLException;

import com.agou.app.admin.demo.easyui.bo.IEasyuiDemoBo;
import com.agou.app.admin.demo.easyui.vo.EasyuiDemoVo;
import com.agou.core.ss.SSException;
import com.agou.core.ss.SSTrace;
import com.agou.ssh.core.base.ActionResultSet;
import com.agou.ssh.core.base.BOResultSet;
import com.agou.ssh.core.base.BaseAction;
import com.opensymphony.xwork2.Action;

public class EasyuiDemoAction extends BaseAction {
	private static final long serialVersionUID = -8357180487207298194L;
	private static SSTrace ssTrace = SSTrace.getInstance(EasyuiDemoAction.class);

	private IEasyuiDemoBo easyuiDemoBo;// 用户登陆业务处理对象
	private EasyuiDemoVo easyuiDemoVo;// 输入
	private ActionResultSet actionResultSet;//输出
	
	public ActionResultSet getActionResultSet() {
		return actionResultSet;
	}

	public void setActionResultSet(ActionResultSet actionResultSet) {
		this.actionResultSet = actionResultSet;
	}

	public EasyuiDemoVo getEasyuiDemoVo() {
		return easyuiDemoVo;
	}

	public void setEasyuiDemoVo(EasyuiDemoVo easyuiDemoVo) {
		this.easyuiDemoVo = easyuiDemoVo;
	}

	public IEasyuiDemoBo getEasyuiDemoBo() {
		return easyuiDemoBo;
	}

	public void setEasyuiDemoBo(IEasyuiDemoBo easyuiDemoBo) {
		this.easyuiDemoBo = easyuiDemoBo;
	}

	public String queryEasyuiTree() throws SSException, SQLException,
			IOException {
		ActionResultSet actionResult = new ActionResultSet(EasyuiDemoAction.class);
		try{
			ssTrace.debug("queryEasyuiTree", "开始执行action");
			this.jdbcBeging(false, false);// 不使用事务
			this.getEasyuiDemoBo().setJdbcSession(this.getJdbcSession());// bo对象如果使用数据库操作，需要进行初始化
			BOResultSet boResultSet = this.getEasyuiDemoBo().queryEasyuiTree();
			actionResult.addBoResultSet("easyuitree", boResultSet);
			this.setActionResultSet(actionResult);
			return Action.SUCCESS;
		}finally{
			this.destroy();//
		}
		
	}

}
